//导航栏 -- 返回 标题 按钮
Vue.component('j-button',{
    template:`
        <button class="button" @click="$emit('click')" :style="{background:type}">{{title}}</button>
    `,
    props:{
        title:String,
        type:{
            type:String,
            validator(val){
                //验证 
                return ['red','green','blue'].indexOf(val) != -1
            }
        }
    },
    data(){
        return {

        }
    },
})
